﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'PRC_TB_USER_IN')
	BEGIN
		DROP  Procedure  dbo.PRC_TB_USER_IN
	END

GO

CREATE PROCEDURE [dbo].[PRC_TB_USER_IN] 
(
    @TU_NAME Varchar(150),
    @TU_LOGIN Varchar(20),
    @TU_PASSWORD Varchar(50),
    @TU_PROFILER_ID Integer,
    @TU_GROUP_ID Integer,
    @TU_EMAIL varchar(250)
)
AS
	INSERT INTO TB_USER
	(TU_NAME,TU_LOGIN,TU_PASSWORD,TU_PROFILER_ID,TU_GROUP_ID,TU_FIRST_ACCESS,TU_EMAIL)
	values
	(@TU_NAME,@TU_LOGIN,@TU_PASSWORD,@TU_PROFILER_ID,@TU_GROUP_ID,0,@TU_EMAIL)
	
select @@identity


GO

GRANT EXEC ON dbo.PRC_TB_USER_IN TO PUBLIC

GO

